$(document).ready(function ()
{
    /**
     * change the display of topbutton with the scrolltop
     * @author : nonglei
     * @date   : 29/04/2014
    $(window).scroll(function ()
    {
        if($(window).scrollTop() <= 100)
        {
            $("#top-button").hide();
        }
        else
        {
            $("#top-button").show();
        }
    });
    passTime();

     */
});
function sentmessage()
{
        if($("#message-content").val() == "")
        {
            alert("请编辑正文");
            return false;
        }
}
function passTime()
{
    var num = parseInt($('#timepass').text());
    num = num + 1;
    var day = parseInt(num / (24 * 3600));
    var hour = parseInt(num % (24 * 3600) /3600);
    var min = parseInt(num % (24 * 3600) % 3600 / 60);
    var sec = parseInt(num % (24 * 3600) % 3600 % 60);
    var time = day + "天" + hour + "小时" + min +"分" + sec + "秒";
    $('#timepass').text(num);
    $('#formattimepass').text(time);
	setTimeout("passTime()",1000)
}

/**
 * the construction of ajax we can use it to sent ajax request
 * @author : nonglei
 * @date   : 2014/06/07
 */
function ajaxConstruction(urlArg, dataArg, dataTypeArg, successArg)
{
    $.ajax({
        url:urlArg,
        type:"POST",
        data:dataArg,
        dataType:dataTypeArg,
        success:successArg,
    });
}
